﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace BreezeEditor.Models
{
    public class Person
    {
        public Person()
        {
            Skills = new List<Skill>();

        }
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string Name { get; set; }
        //[UIHint("Skills")]
        public virtual ICollection<Skill> Skills { get; set; }
    }

    public class Skill
    {
        public Skill()
        {
            Categories = new List<Category>();
        }
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string Name { get; set; }
        [ForeignKey("PersonId")]
        public virtual Person Owner { get; set; }
        public int PersonId { get; set; }
        public virtual ICollection<Category> Categories {get; set;}
    }

    public class Category
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string Name { get; set; }
        [ForeignKey("SkillId")]
        public virtual Skill Parent{ get; set; }
        public int SkillId { get; set; }
    }
}